package cn.iocoder.yudao.module.resource.api;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.resource.api.model.timepackage.TimePackageDTO;
import cn.iocoder.yudao.module.resource.api.model.timepackage.TimePackagePageReqDTO;
import cn.iocoder.yudao.module.resource.controller.admin.timepackage.vo.TimePackagePageReqVO;
import cn.iocoder.yudao.module.resource.service.timepackage.TimePackageService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;

@Service
public class TimePackageApiImpl implements ITimePackageApi {
    @Resource
    private TimePackageService timePackageService;

    @Override
    public TimePackageDTO getTimePackage(String id) {
        return BeanUtils.toBean(timePackageService.getTimePackage(id), TimePackageDTO.class);
    }

    @Override
    public List<TimePackageDTO> getTimePackageList(Collection<String> ids) {
        return BeanUtils.toBean(timePackageService.getTimePackageList(ids), TimePackageDTO.class);
    }

    @Override
    public PageResult<TimePackageDTO> getTimePackagePage(TimePackagePageReqDTO pageReqVO) {
        return BeanUtils.toBean(timePackageService.getTimePackagePage(BeanUtils.toBean(pageReqVO, TimePackagePageReqVO.class)), TimePackageDTO.class);
    }
}
